

#ifndef _ZAXLOCK_H
#define _ZAXLOCK_H

#include "zacadstrc.h"

#pragma pack (push, 8)

class UcDbDatabase;
class UcDbObjectId;

class UcAxDocLock
{
public:

    enum DocLockType
    {
        kNormal         = 0,    
        kCurDocSwitch   = 1

    };

    UcAxDocLock();    
    UcAxDocLock(const UcDbObjectId& objectId, DocLockType = kNormal);
    UcAxDocLock(UcDbDatabase * pDatabase, DocLockType = kNormal);

    ~UcAxDocLock();

    Ucad::ErrorStatus lockStatus() const;

private:

    void lockDocument(UcDbDatabase* pDatabase, DocLockType lockType = kNormal);
    void initialize();

    Ucad::ErrorStatus   m_lockStatus;
    void*               m_pDocToUnlock;
    void*               m_pCurDocToRestore;
    bool                m_restoreActivation;
};

#pragma pack (pop)

#endif      
